<template>
    <div
        class="daily-contnair"
        v-loading="isLoading"
        element-loading-background="rgba(250, 250, 250, 0.7)"
    >
        <!-- 日满分专项分期 -->
        <!-- <el-card
      shadow="never"
      v-loading="isLoading"
      element-loading-background="rgba(250, 250, 250, 0.7)"
    >
      <div slot="headerss" class="clearfix">
        <span>日满分专项分期</span>
        <el-button style="float: right; padding: 3px 20px;" type="text" @click="showTrial=false">关 闭</el-button>
        </div>-->
        <cardComponent pageTitle="日满分专项分期">
            <template slot="cardBody">
                <el-form
                    ref="dailyFullsFormRef"
                    :rules="dailyFullsFormRules"
                    :model="dailyFullsForm"
                    label-width="150px"
                    size="small"
                    style="width: 800px;  margin: 0 auto; padding-right: 20px"
                >
                    <el-row :gutter="15">
                        <el-col :span="12">
                            <el-form-item label="账户类别 : ">
                                <el-input disabled v-model="dailyFullsForm.CATEGORY"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="日满分贷款额度 : ">
                                <el-input disabled v-model="dailyFullsForm.LMPAUTHS"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12">
                            <el-form-item label="客户姓名 : ">
                                <el-input disabled v-model="dailyFullsForm.CUSTRNAME"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="日满分贷款可用额度 : ">
                                <el-input
                                    class="t-red"
                                    disabled
                                    :value="dailyFullsForm.MPWLIMAVL >= dailyFullsForm.DAILYAVAIL ? dailyFullsForm.DAILYAVAIL : dailyFullsForm.MPWLIMAVL"
                                ></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12">
                            <el-form-item label="证件号码 : ">
                                <el-input disabled v-model="dailyFullsForm.CUSTID"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="日满分金额 : " prop="LNAMT">
                                <el-input v-model.number="dailyFullsForm.LNAMT"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12">
                            <el-form-item label="主卡卡号 : ">
                                <el-input disabled v-model="dailyFullsForm.CARDNO"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="日满分天数 : " prop="LNDAYS">
                                <el-input v-model.number="dailyFullsForm.LNDAYS"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12">
                            <el-form-item label="签约借记卡卡号 : ">
                                <el-input disabled v-model="dailyFullsForm.CARDNAME"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="转入银行卡类型 : " prop="OUTFLAG">
                                <el-select
                                    v-model="dailyFullsForm.OUTFLAG"
                                    placeholder="请选择转入银行卡类型"
                                    style="width: 100%;"
                                >
                                    <el-option label="无" value></el-option>
                                    <el-option label="本行" value="C"></el-option>
                                    <el-option label="他行" value="X"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>

                    <el-form-item size="large" label-width="0">
                        <el-button
                            type="primary"
                            size="small"
                            @click="onTrial('dailyFullsFormRef')"
                        >试 算</el-button>
                        <el-button type="primary" size="small" @click="showEditInfor">修改信息</el-button>
                        <!-- 4094贷记卡系统日满分专项分期款申请 -->
                        <el-button
                            type="primary"
                            size="small"
                            @click="onApplyConfirm('dailyFullsFormRef')"
                        >申 请</el-button>
                    </el-form-item>
                </el-form>
                <!-- </el-card> -->

                <!-- 试算展示结果窗口 -->
                <el-card shadow="never" v-if="showTrial">
                    <div slot="headerss" class="clearfix">
                        <span style=" padding: 0px 0px 0px 60px;">日满分专项分期试算</span>
                        <el-button
                            style="float: right; padding: 3px 20px;"
                            type="text"
                            @click="showTrial=false"
                        >关 闭</el-button>
                    </div>
                    <el-table
                        :data="trailTable"
                        stripe
                        style="width: 100%;"
                        border
                        class="heard-bg business_table"
                    >
                        <el-table-column prop="LNAMT" label="日满分贷款金额"></el-table-column>
                        <el-table-column prop="LNDAYS" label="日满分贷款天数"></el-table-column>
                        <el-table-column prop="PAYCFDAY" label="日满分贷款到期日"></el-table-column>
                        <el-table-column prop="FEERATE" label="日满分贷款息费率"></el-table-column>
                        <el-table-column prop="FEEAMT" label="日满分贷款息费"></el-table-column>
                    </el-table>
                </el-card>

                <!-- 修改信息窗口 -->
                <el-dialog
                    v-drag
                    title="日满分资料修改"
                    :visible.sync="showEdit"
                    append-to-body
                    @close="closeEdit"
                    center
                    :close-on-click-modal="false"
                    width="500px"
                >
                    <el-form
                        :model="dailyFullsEditForm"
                        :rules="dailyFullsEditRules"
                        ref="dailyFullsEditFormRef"
                        label-width="220px"
                        size="small"
                    >
                        <el-form-item label="账户类别 : ">
                            <el-input
                                class="b-0"
                                readonly
                                v-model="dailyFullsEditForm.CATEGORY"
                                style="width: 200px;"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="主卡卡号 : ">
                            <el-input
                                class="b-0"
                                readonly
                                v-model="dailyFullsEditForm.CARDNO"
                                style="width: 200px;"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="申请转入的银行卡号 : " prop="OUTCARDNBR">
                            <el-input
                                v-model.number="dailyFullsEditForm.OUTCARDNBR"
                                style="width: 200px;"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="申请转入的银行行号 : " prop="OUTBANK">
                            <el-input
                                v-model.number="dailyFullsEditForm.OUTBANK"
                                style="width: 200px;"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="申请转入的银行卡银行名称 : " prop="OUTBANKNAME">
                            <el-input
                                v-model="dailyFullsEditForm.OUTBANKNAME"
                                style="width: 200px;"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="申请转入的银行卡卡片有效期 : " prop="OUTEXP">
                            <el-input
                                v-model="dailyFullsEditForm.OUTEXP"
                                maxlength="4"
                                style="width: 200px;"
                                placeholder="格式 : (MMYY)"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="申请转入银行卡类型 : " prop="OUTFLAG">
                            <el-select
                                v-model="dailyFullsEditForm.OUTFLAG"
                                placeholder="请选择转入银行卡类型"
                                style="width: 200px;"
                            >
                                <el-option label="无" value></el-option>
                                <el-option label="本行" value="C"></el-option>
                                <el-option label="他行" value="X"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button
                            size="small"
                            icon="el-icon-circle-close"
                            @click="showEdit = false"
                        >取 消</el-button>
                        <el-button
                            type="primary"
                            size="small"
                            @click="onEditInfor('dailyFullsEditFormRef')"
                            icon="el-icon-circle-check"
                            v-preventReClick
                        >确定</el-button>
                    </div>
                </el-dialog>

                <!-- 申请确定窗口 -->
                <el-dialog
                    v-drag
                    title="日满分专项分期款申请信息确定"
                    :visible.sync="showApplyConfirm"
                    append-to-body
                    center
                    :close-on-click-modal="false"
                    width="500px"
                >
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>卡号:</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{dailyFullsForm.CARDNBR || '' }}</span>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>卡产品 :</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{productName || '' }}</span>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>签约借记卡卡号 :</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{dailyFullsForm.CARDNAME || '' }}</span>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>日满分专项分期金额 :</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{dailyFullsForm.LNAMT || '' }}</span>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>日满分专项分期天数 :</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{dailyFullsForm.LNDAYS || '' }}</span>
                        </el-col>
                    </el-row>
                    <el-row :gutter="15">
                        <el-col :span="12" style="text-align: right">
                            <span>转入银行卡类型 :</span>
                        </el-col>
                        <el-col :span="12">
                            <span>{{dailyFullsForm.OUTFLAG === "C" ? "本行" : "他行"}}</span>
                        </el-col>
                    </el-row>

                    <div slot="footer" class="dialog-footer">
                        <el-button
                            size="small"
                            icon="el-icon-circle-close"
                            @click="onApplyDaily('0')"
                        >取 消</el-button>
                        <el-button
                            type="primary"
                            size="small"
                            @click="onApplyDaily('1')"
                            icon="el-icon-circle-check"
                            v-preventReClick
                        >确定</el-button>
                    </div>
                </el-dialog>

                <!-- 申请成功返回提示 -->
                <ConfirmWindow
                    v-if="showApplydaily"
                    @isShow="close"
                    :dataList="ApplydailyForm"
                    :title="'日满分申请成功,请勿重复申请！'"
                />
                <!-- <el-dialog v-drag
          title="日满分申请成功！"
          :visible.sync="showApplydaily"
          :show-close="false"
          append-to-body
          center
          width="500px"
        >
          <el-form :model="ApplydailyForm" label-width="180px" size="small">
            <el-form-item label="日满分金额 : ">
              <el-input disabled v-model="ApplydailyForm.LNAMT" style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="	日满分天数 : ">
              <el-input disabled v-model="ApplydailyForm.LNDAYS" style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="日满分到期日 : ">
              <el-input disabled v-model="ApplydailyForm.PAYCFDAY" style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="日满分息费率 : ">
              <el-input disabled v-model="ApplydailyForm.FEERATE" style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="日满分息费 : ">
              <el-input disabled v-model="ApplydailyForm.FEEAMT" style="width: 200px;"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" size="small" @click="showApplydaily=false"size="small" icon="el-icon-circle-check" >确定</el-button>
          </div>
                </el-dialog>-->
            </template>
        </cardComponent>
    </div>
</template>

<script>
import { mapState } from 'vuex';
import moment from 'moment';
import { __awaiter } from 'tslib';
import cardComponent from '@/components/cardComponent/cardComponent.vue';
import ConfirmWindow from '@/components/ConfirmWindow/ConfirmWindow.vue';
import { get_3xxx, get_4xxx, get_FQxx } from '@/apis/getAPIClass';
import { setNumber, tbBudgetRequisi } from '@/utils/Object';
import {
    getDictValue, closePage, itoStr, getDictMappingValue,
} from '@/utils/Common';

export default {
    data() {
        return {
            dailyFullsForm: {
                CATEGORY: '', // 3052
                CUSTRNAME: '', // 3052
                CUSTID: '', // 3052
                CARDNO: '', // 3001
                CARDNAME: '', // 3052
                CALLIMIT: '', // 3001
                AVLIMT: '', // 3001
                LNAMT: '',
                LNDAYS: '',
                OUTFLAG: undefined,
                MPWLIMAVL: '', // 按日贷可用限额 3102
                DAILYAVAIL: '', // 占用大额分期额度的按日贷款可用额度 3001
            },
            productName: '',
            ApplydailyForm: [],
            showApplydaily: false,
            dailyFullsEditForm: {
                CATEGORY: '',
                CARDNO: '',
                OUTCARDNBR: '',
                OUTBANK: '',
                OUTBANKNAME: '',
                OUTEXP: '',
                OUTFLAG: '',
            },
            trailTable: [
                {
                    LNAMT: '0',
                    LNDAYS: '0',
                    PAYCFDAY: '0',
                    FEERATE: '0',
                    FEEAMT: '0',
                },
            ],
            dailyFullsFormRules: {
                LNAMT: [
                    {
                        required: true,
                        message: '请输入正确的分期金额！',
                        trigger: 'blur',
                    },
                    { type: 'number', message: '分期金额只能为数字！', trigger: 'blur' },
                    {
                        validator: (rule, value, callback) => {
                            if (this.dailyFullsForm.DAILYAVAIL < 20000) {
                                callback(new Error('日满分贷款可用额度不足！'));
                            } else if (
                                value < 20000
                                || value > this.dailyFullsForm.DAILYAVAIL
                            ) {
                                callback(
                                    new Error(
                                        `日满分金额应该在20000-${this.dailyFullsForm.DAILYAVAIL}！`,
                                    ),
                                );
                            } else if (parseInt(value, 10) % 100 != 0) {
                                callback(new Error('日满分金额只能是整百的!'));
                            } else {
                                callback();
                            }
                        },
                        trigger: 'blur',
                    },
                ],
                LNDAYS: [
                    {
                        required: true,
                        message: '请输入正确的分期天数！',
                        trigger: 'blur',
                    },
                    { type: 'number', message: '分期天数只能为数字！', trigger: 'blur' },
                    {
                        validator: (rule, value, callback) => {
                            if (value < 10) {
                                callback(new Error('日满分专项分期款天数应在10天以上！'));
                            } else {
                                callback();
                            }
                        },
                        trigger: 'blur',
                    },
                ],
                OUTFLAG: [
                    { required: true, message: '请选择转入银行卡类型', trigger: 'change' },
                ],
            },
            dailyFullsEditRules: {
                OUTCARDNBR: [
                    {
                        required: true,
                        message: '请输入转入银行卡号！',
                        trigger: 'blur',
                    },
                    { type: 'number', message: '银行卡号只能为数字！', trigger: 'blur' },
                ],
                OUTBANK: [
                    {
                        required: true,
                        message: '请输入转入银行行号！',
                        trigger: 'blur',
                    },
                    { type: 'number', message: '银行行号只能为数字！', trigger: 'blur' },
                ],
                OUTBANKNAME: [
                    {
                        required: true,
                        message: '请输入转入银行名称！',
                        trigger: 'blur',
                    },
                ],
                OUTEXP: [
                    {
                        required: true,
                        message: '请输入转入银行卡有效期！',
                        trigger: 'blur',
                    },
                ],
                OUTFLAG: [
                    { required: true, message: '请选择转入银行卡类型', trigger: 'change' },
                ],
            },
            showTrial: false,
            showEdit: false,
            isLoading: false,
            showTrialTable: false,
            showApplyConfirm: false,
            productId: '',
        };
    },
    name: 'dailyfulls',
    components: {
        cardComponent,
        ConfirmWindow,
    },
    async mounted() {
        // 判断是否有当前权限
        await this.getExecuteFun();
        if (this.isLoading) return false;
        this.onLoadOBJ();
    },
    computed: mapState({
        defaultParams: state => state.common.defaultParams, // 接口默认参数
        cardInfo_3004: state => state.common.cardInfo_3004,
        cardList_3601: state => state.common.cardList_3601,
        inlineParams: state => state.common.inlineParams, // 卡系统交易请求报文,
        pinFlag: state => state.common.pinFlag, // 是否密码检查标志
    }),
    methods: {
        // 判断是否有当前权限
        async getExecuteFun() {
            this.isLoading = true;
            this.productId = itoStr(this.cardInfo_3004.PRODUCT, 4) || this.cardInfo_3004.PRODUCT;
            console.log(this.productId);
            if (this.productId !== '0033') {
                return this.$alert(
                    '该卡种不支持日满分专项分期！',
                    '接口提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                ).then(() => {
                    closePage(this.$route, this, 1);
                });
            } this.isLoading = false;
        },
        // 页面加载获取页面数据请求_3052_3001请求
        async onLoadOBJ() {
            this.dailyFullsForm.CARDNO = this.cardInfo_3004.CARDNO;
            // this.sizeForm.CATEGORY = this.cardInfo_3004.CATEGORY;
            this.isLoading = true;
            // 3052 配置请求头
            const appBody_3052 = {
                CARDNBR: this.cardInfo_3004.CARDNO || '', // 卡号,
                PINFLAG: this.pinFlag,
                INQOPT: 1,
            };
            // 3001 配置请求头
            const appBody_3001 = {
                CARDNO: this.cardInfo_3004.CARDNO || '',
                PINFLAG: this.pinFlag,
            };
            // 3112 配置请求头
            const appBody_3112 = {
                CARDNBR: this.cardInfo_3004.CARDNO || '',
                PINFLAG: this.pinFlag,
            };
            // 发送_3052_3001_3112请求
            const result_3052 = await get_3xxx(
                '3052',
                '日满分专项分期',
                appBody_3052,
                this,
                false,
            );
            const result_3112 = await get_3xxx(
                '3112',
                '日满分专项分期',
                appBody_3112,
                this,
                false,
            );
            const result_3001 = await get_3xxx(
                '3001',
                '日满分专项分期',
                appBody_3001,
                this,
            );
            // console.log(result_3052, result_3001, result_3112);

            // this.dailyFullsForm.MPWLIMAVL = result_3112.body.appBody.MPWLIMAVL

            // 获取账户类别
            const MY_CATEGORY = await getDictMappingValue('CATE', this.cardInfo_3004.CATEGORY, this) || this.cardInfo_3004.CATEGORY;
            const productName = await getDictValue(
                this.cardList_3601,
                this.cardInfo_3004.CARDNO,
                'PRODUCT',
                this,
            );

            this.productName = productName;

            this.dailyFullsForm = {
                CATEGORY: MY_CATEGORY,
                CARDNO: this.cardInfo_3004.CARDNO,
                ...result_3112.body.appBody,
                ...result_3052.body.appBody,
                ...result_3001.body.appBody,
            };

            this.isLoading = false;
        },
        // 试算请求 4094 请求
        onTrial(ref) {
            this.isLoading = true;
            this.$refs[ref].validate(async (valid) => {
                if (valid) {
                    // 请求他行接口
                    // 4094 配置请求头
                    const appBody_4094 = {
                        CARDNBR: this.cardInfo_3004.CARDNO,
                        OPTION: 1,
                        PINFLAG: this.pinFlag,
                        LNAMT: this.dailyFullsForm.LNAMT * 100,
                        LNDAYS: this.dailyFullsForm.LNDAYS,
                        PLANID: '1001',
                    };
                    const result_4094 = await get_4xxx(
                        '4094',
                        '日满分试算',
                        appBody_4094,
                        this,
                    );
                    if (!result_4094) return false;
                    result_4094.body.appBody.PAYCFDAY = moment(
                        `${result_4094.body.appBody.PAYCFDAY}`,
                    ).format('YYYY-MM-DD');
                    this.$message.success('获取数据成功');
                    this.trailTable = [{ ...result_4094.body.appBody }];
                    this.isLoading = false;
                    this.showTrial = true;
                } else {
                    this.$message.error('验证错误，请核实填写数据！');
                    return false;
                }
            });
            this.isLoading = false;
        },
        // 展示 日满分专项分期款资料修改 弹窗
        showEditInfor() {
            this.dailyFullsEditForm.CATEGORY = this.dailyFullsForm.CATEGORY;
            this.dailyFullsEditForm.CARDNO = this.dailyFullsForm.CARDNO;
            this.showEdit = true;
        },
        // 日满分专项分期款资料修改 4075 请求
        onEditInfor(ref) {
            this.$refs[ref].validate(async (valid) => {
                if (valid) {
                    const confirmResult = await this.$confirm(
                        '此操作将对日满分专项分期款资料修改, 是否继续?',
                        '日满分专项分期款资料修提示',
                        {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            customClass: 'warning', type: 'warning',
                        },
                    ).catch(err => err);
                    if (confirmResult !== 'confirm') return this.$message.info('已取消修改');

                    // 4075 配置请求头
                    const appBody_4075 = {
                        CARDNBR: this.cardInfo_3004.CARDNO || '',
                        OPERTP: 0,
                        MPDRTYN: 0,
                        BTYPE: 0,
                        OUTCARDNBR: this.dailyFullsEditForm.OUTCARDNBR,
                        OUTBANK: this.dailyFullsEditForm.OUTBANK,
                        OUTBANKNAME: this.dailyFullsEditForm.OUTBANKNAME,
                        OUTEXP: this.dailyFullsEditForm.OUTEXP,
                        OUTFLAG: this.dailyFullsEditForm.OUTFLAG,
                    };

                    const result_4075 = await get_4xxx(
                        '4075',
                        '日满分修改',
                        appBody_4075,
                        this,
                    );
                    this.showEdit = false;
                    if (!result_4075) return false;

                    if (result_4075.body.appHead.retCode === '000000') {
                        this.$message.success('日满分专项分期款资料修改成功');
                        this.$refs.dailyFullsFormRef.resetFields();
                    } else {
                        this.$message.error('日满分专项分期款资料修改失败！');
                    }
                }
                this.$refs.dailyFullsFormRef.resetFields();
            });
        },
        // 展示 日满分专项分期款申请确定 弹窗
        onApplyConfirm(ref) {
            this.$refs[ref].validate(async (valid) => {
                if (valid) {
                    this.showApplyConfirm = true;
                }
            });
        },
        closeEdit() {
            this.$refs.dailyFullsEditFormRef.resetFields();
        },
        // 日满分专项分期款申请请求
        async onApplyDaily(a) {
            this.isLoading = true;
            this.showApplyConfirm = false;
            if (a === '0') {
                this.showApplyConfirm = false;
                this.isLoading = false;
                return this.$message.info('已取消申请');
            }
            let PLANID = '1001'; // 改变转入银行卡类型
            const LNAMT = this.dailyFullsForm.LNAMT * 100;
            let res = {};

            if (this.dailyFullsForm.OUTFLAG === 'C') {
                PLANID = '1002';
                // 请求行内接口
                // 请求行内接口
                const appBody_FQ02 = {
                    CARDNBR: this.dailyFullsForm.CARDNBR,
                    OUTCARD: this.dailyFullsForm.CARDNAME, // 申请转入的银行卡卡号借记卡卡号
                    // OUTBANKNAME: this.dailyEditForm.OUTBANKNAME , // 申请转入的银行卡银行名称
                    OPTION: 0, // 0/空格：申请  1：试算
                    SOURCE: 'AG', // 交易来源
                    PINFLAG: '0010',
                    LNRATE: 0,
                    LNAMT,
                    LNDAYS: this.dailyFullsForm.LNDAYS,
                    PLANID,
                };
                console.log(appBody_FQ02);
                // 发送_FQ02请求 //   数据存在 resultData.body.appBody
                const result_FQ02 = await get_FQxx(
                    'FQ02',
                    '日满分申请',
                    appBody_FQ02,
                    this,
                );
                console.log(result_FQ02);
                if (!result_FQ02) return false;
                result_FQ02.body.appBody.PAYCFDAY = moment(
                    `${result_FQ02.body.appBody.PAYCFDAY}`,
                ).format('YYYY-MM-DD');
                res = result_FQ02.body.appBody;
                // this.ApplydailyForm = { ...result_FQ02.body.appBody };
                // this.$refs.dailyFullsFormRef.resetFields();
                // this.showApplydaily = true;
                // this.isLoading = false;
                // this.isLoading = false;
            } else {
                // 请求他行接口
                // 4094 配置请求头
                const appBody_4094 = {
                    CARDNBR: this.cardInfo_3004.CARDNO,
                    OPTION: 0, // 0/空格：申请  1：试算
                    PINFLAG: this.pinFlag,
                    LNAMT: this.dailyFullsForm.LNAMT * 100,
                    LNDAYS: this.dailyFullsForm.LNDAYS,
                    PLANID,
                };
                // 发送_4094请求 //   数据存在 resultData.body.appBody
                const result_4094 = await get_4xxx(
                    '4094',
                    '日满分申请',
                    appBody_4094,
                    this,
                );
                console.log(result_4094);
                if (!result_4094) return false;
                result_4094.body.appBody.PAYCFDAY = moment(
                    `${result_4094.body.appBody.PAYCFDAY}`,
                ).format('YYYY-MM-DD');
                res = result_4094.body.appBody;
            }
            // this.ApplydailyForm = { ...result_4094.body.appBody };
            this.ApplydailyForm = [
                { keys: '日满分金额 : ', values: res.LNAMT },
                { keys: '日满分天数 : ', values: res.LNDAYS },
                { keys: '日满分到期日 : ', values: res.PAYCFDAY },
                { keys: '日满分息费率 : ', values: res.FEERATE },
                { keys: '日满分息费 : ', values: res.FEEAMT },
            ];

            this.showApplydaily = true;
            // 发送新增分期申请记录 tbBudgetRequisi
            const tbBudgetRequisiData = JSON.parse(JSON.stringify(tbBudgetRequisi));
            tbBudgetRequisiData.agentid = this.defaultParams.body.appHead.opeNo;
            tbBudgetRequisiData.allcountfee = res.FEEAMT;
            tbBudgetRequisiData.banknum = this.defaultParams.body.appHead.bnknbr;
            tbBudgetRequisiData.budgettype = res.OPTION;
            tbBudgetRequisiData.custid = this.cardInfo_3004.CUSTID || '无';
            tbBudgetRequisiData.custname = this.cardInfo_3004.NAME;
            tbBudgetRequisiData.custno = res.CARDNBR;
            tbBudgetRequisiData.instalamt = res.LNAMT;
            tbBudgetRequisiData.jzrate = res.FEERATE;
            tbBudgetRequisiData.planno = res.PLANID;
            tbBudgetRequisiData.retcode = '000000';
            tbBudgetRequisiData.monthnbr = res.LNDAYS;

            console.log(tbBudgetRequisiData);
            try {
                const resss = await this.$post.businessStatistics.addTbBudgetRe(tbBudgetRequisiData);
                console.log(resss);
            } catch (error) {
                console.warn(error);
            }

            this.$refs.dailyFullsFormRef.resetFields();
            this.showApplyConfirm = false;
        },
        close(data) {
            this.showApplydaily = data;
        },
    },
};
</script>

<style  scoped lang="scss">
.daily-contnair {
    /deep/.el-card__header {
        padding: 8px !important;
    }
    .form-row {
        width: 400px;
        margin: 0 auto;
        .el-select {
            width: 100%;
            // margin-bottom: 15px;
        }
    }
    /deep/.el-row {
        margin-bottom: 10px;
    }
    .el-form-item {
        text-align: center;
    }
}
</style>
